package com.banciyuan.bcywebview.base.helper;

import de.greenrobot.daoexample.model.NotificationData;

/**
 * Created by hfxt2008 on 13-10-24.
 */
public class FlagUtils {
    public static boolean ifMimeUpdate = false;//新的请求中是否我的中有更新;包括新粉丝数，ask数目

    public static int newFansNum = 0;//新粉丝数量
    public static int newAskNum = 0; //新的ask数量
    public static boolean ifAnnounce = false;//是否公告有更新
    public static boolean ifMessage = false;//是否私信有更新
    public static boolean ifGroupUpdate = false;//是否小组话题有更新
    public static boolean ifNotifyUpdate = false;//是否评论有更新
    public static boolean ifRemindUpdate = false;//是否提醒有更新
    public static boolean ifSerializeUpdate = false;//是否有连载更新

    public static void storeNotificationData(NotificationData notificationData) {
        ifGroupUpdate = notificationData.getGroup() > 0;
        ifNotifyUpdate = notificationData.getNotify() > 0;
        ifRemindUpdate = notificationData.getRemind() > 0;
        ifSerializeUpdate = notificationData.getNovel_update() > 0;
        ifAnnounce = notificationData.getAnnounce() > 0;
        ifMessage = notificationData.getMessage() > 0;
        //处理我的中的ask数量和新增粉丝数
        newAskNum = notificationData.getAsk_count();
        newFansNum = notificationData.getUser_follow();
    }

    public static boolean hasNewNotify() {
        return FlagUtils.ifGroupUpdate || FlagUtils.newAskNum > 0 || FlagUtils.newFansNum > 0 || FlagUtils.ifNotifyUpdate
                || FlagUtils.ifRemindUpdate || FlagUtils.ifSerializeUpdate || FlagUtils.ifAnnounce || FlagUtils.ifMessage;
    }
}
